package com.kaishengit.web;


import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;



import com.kaishengit.util.WeatherUtil;

public class WeatherServlet extends HttpServlet {

	
	private static final long serialVersionUID = 1L;
@Override
protected void service(HttpServletRequest request, HttpServletResponse response)
		throws ServletException, IOException {
	String xml=WeatherUtil.HttpConnection("http://www.google.com/ig/api?hl=zh-cn&weather=jiaozuo", "gbk");
	response.setContentType("text/xml;charset=utf-8");
	PrintWriter   out = response.getWriter();
	out.append(xml);
	out.flush();
	out.close();
}
}
